﻿
Imports osi.root.utils

Public Class idevice_pool_wrapper(Of impl_T As idevice_pool)
    Implements idevice_pool

    Public Event closing() Implements idevice_pool.closing
    Protected ReadOnly impl As impl_T

    Public Sub New(ByVal i As impl_T)
        assert(Not i Is Nothing)
        Me.impl = i
        AddHandler i.closing,
                   Sub()
                       RaiseEvent closing()
                   End Sub
    End Sub

    Public Sub close() Implements idevice_pool.close
        impl.close()
    End Sub

    Public Function expired() As Boolean Implements idevice_pool.expired
        Return impl.expired()
    End Function

    Public Function free_count() As UInt32 Implements idevice_pool.free_count
        Return impl.free_count()
    End Function

    Public Function identity() As String Implements idevice_pool.identity
        Return impl.identity()
    End Function

    Public Function max_count() As UInt32 Implements idevice_pool.max_count
        Return impl.max_count()
    End Function

    Public Function total_count() As UInt32 Implements idevice_pool.total_count
        Return impl.total_count()
    End Function
End Class
